package com.love.poetry.infrastructure.persist.poetry.impl;

import org.springframework.stereotype.Repository;

import com.love.poetry.domain.poetry.Poet;
import com.love.poetry.infrastructure.persist.poetry.PoetRepository;
import com.youboy.core.orm.mybatis.MybatisRepositorySupport;

@Repository
public class MybatisPoetRepository extends MybatisRepositorySupport<String, Poet> implements PoetRepository {

	@Override
	protected String getNamespace() {
		return "com.love.poetry.domain.poetry.Poet";
	}
	
	public void delete(String id) {
		 getSqlSession().delete(getNamespace() + ".delete", id);
	}

	public Poet queryUniqueByName(String name) {
		return (Poet) getSqlSession().selectOne(getNamespace() + ".queryUniqueByName", name);
	}	
}